//HalfCircle.cpp
//Contains the function definitions for the HalfCircle Class

#include <math.h>
#include <iostream>
#include "HalfCircle.h"

using namespace std;

HalfCircle::HalfCircle(const float &p_X, const float &p_Y, float rad)
	:CircularShapes(p_X, p_Y)
{
	setRadius(rad);
	setArea(rad);
	setPerim(rad);
	setShapeType("HalfCircle");
	//setDistance();
}

void HalfCircle::setRadius(float rad)
{
	if(rad >= 0.0)
		radius = rad;
	else
		cout << "Radius must be greater than zero!";
}

float HalfCircle::getRadius() const
{
	return radius;
}

void HalfCircle::setArea(float rad)
{
	HC_area = 0.5 * 3.14159265359 * pow(rad, 2);
}

float HalfCircle::getArea() const
{
	return HC_area;
}

void HalfCircle::setPerim(float rad)
{
	HC_perimeter = 3.14159265359 * rad + 2 * rad;
}

float HalfCircle::getPerim() const
{
	return HC_perimeter;
}

float HalfCircle::area() const
{
	return getArea();
}

float HalfCircle::perimeter() const
{
	return getPerim();
}

float HalfCircle::volume() const
{
	return 0.0;
}

